package com.gxl.butt;
/**
 * Created by Administrator on 2018/11/26.
 */
public class Students<T> {
    private T score;
    public void setScore(T data){
        this.score = data;
    }
    public T getScore(){
        return this.score;
    }
    public static void main(String[] args){
        Students<MathScore> scoreStudents1 = new Students<>();
        MathScore mathScore = new MathScore();
        mathScore.setId(1L);
        mathScore.setNum(89L);
        Students<EnglishScroe> scoreStudents2 = new Students<>();
        EnglishScroe englishScroe = new EnglishScroe();
        englishScroe.setId(2L);
        englishScroe.setNum(90L);
        scoreStudents1.setScore(mathScore);
        scoreStudents2.setScore(englishScroe);
        System.out.println(scoreStudents1.getScore().getName() + " scroe :" + scoreStudents1.getScore().getNum());
        System.out.println(scoreStudents2.getScore().getName() + " scroe :" + scoreStudents2.getScore().getNum());

    }
}
